In computer systems, shared memory may refer to memory that can be accessed simultaneously by different resources, such as computer hardware or software. In computer hardware, shared memory is generally random access memory (RAM) that is accessible from different central processing units (CPUs) in a multi-processor system. In computer software, shared memory generally refers to an area of RAM that is accessible to multiple processes or threads. In software systems, such availability allows a single copy of data to service multiple resources, instead of providing a separate copy of the data for each specific resource.
Virtual memory generally refers to a method of memory management where virtual memory addresses are mapped to physical memory addresses of a computer system. An operating system usually manages virtual address spaces and assignment of physical memory to virtual memory. Memory address translation is usually performed by a memory management unit (MMU) of a CPU. In virtual memory management, data sharing between different processes is usually implemented by mapping a virtual address of each different process to the same physical memory address so that each process accesses the same copy of data.